<%if user_signed_in? %>
  <a href="categories/new"><button type="button" class="btn btn-primary" style="background-color:#B6AAEA">Nueva categoria</button></a>
  <% end  %>
<div id="row-fluid">
  <div id="span 12">
    <div id="well">
      <ul class="nav nav-tabs" id="myTab">
        <% cont = 0 %>
        <% @categories.each do |c| %>
          
          <li class="<% if cont== 0 %> <%= "active" %><% cont = 1%><% end %>"><a href="#<%= c.id %>" data-toggle="tab"><%= c.name %></a></li>
          
        <% end %>

      </ul>
       
      <div class="tab-content">
        <% cont = 0
        @categories.each do |c| %>          
            <div class="tab-pane <% if cont==0  %><%= "active" %><% cont = 1  %><% end %>" id="<%= c.id %>" >
              <% if user_signed_in? %>
              <div class=".col-md-12" align="right">
                <%= link_to 'Eliminar', c, method: :delete, data: { confirm: 'Está seguro?' } %>
              </div>
              <% end %>
              <%=render "articles/index", :target => c %>
            </div>
        <% end %>
      </div>
      
    </div>
  </div>
</div>